﻿@model Model.AppUserList
@{
    ViewBag.Title = "BatchOderInfo";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@using Model


@section JQscriptSection{
    <script type="text/javascript">
        $(document).ready(function () {
            var curr_time = new Date();
            var strDate = curr_time.getFullYear() + "-";
            strDate += curr_time.getMonth() + 1 + "-";
            strDate += curr_time.getDate();
            $("#FJStartDate").datebox("setValue", strDate);
            $("#FJEndDate").datebox("setValue", strDate);

            InitGrid();

        });

        HandleDom.ClassTriggerClick("icon-exporter", function () {
            ExporterExcel();
        });



        //初始化数据
        function InitGrid() {
            var startDate = $('#FJStartDate').datebox('getValue');
            var endDate = $('#FJEndDate').datebox('getValue');
            var batchNo = $('#selBatch').combobox('getValue');
            queryParams = {
                startDate: startDate,
                endDate: endDate,
                batchNo: batchNo
            }
            HandleData.InitDataGrid('dg', '/BatchOderInfo/InitJsonResult', 'toolbar', queryParams, 'GOODSID', false, function (data) { },
                function (rowIndex, rowData) {//双击
                    edit(rowData);
                });
        }
        //导出预估生产单
        function ExporterExcel() {
            var form = $('#query');
            var fjstartDate = $('#FJStartDate').datebox('getValue');
            var fjendDate = $('#FJEndDate').datebox('getValue');
            var batchNo = $('#selBatch').combobox('getValue');
            var batch_name = $("#selBatch  option:selected").text();
            form.form('submit', {
                url: '@Url.Content("~/BatchOderInfo/ExporterExcelDetail")' + "?fjstartTime=" + fjstartDate + "&fjendTime=" + fjendDate + "&batchNo=" + batchNo + "&batchName=" + batch_name,
                success: function (data) {
                    eval('data=' + data);
                    if (data.success) {
                        layer.alert('导出成功!', 9);
                    } else {
                        layer.alert(data.msg, 3);
                    }
                }
            });
        }


    </script>
}
<body style="background-color: ButtonFace; font-size: 17px">
    <div class="easyui-panel" title="查询条件" style="height: 130px; padding: 5px; background: #fafafa; width: 1700px;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>
                        分拣时间:
                    </td>
                    <td>
                        <input class="easyui-datebox" id="FJStartDate" name="FJStartDate" style="width: 140px;" />
                    </td>
                    <td>
                        ~：
                    </td>
                    <td>
                        <input class="easyui-datebox" id="FJEndDate" name="FJEndDate" style="width: 140px;" validtype="compareDate['#FJStartDate']" />
                    </td>
                    <td>
                        批次选择:
                    </td>
                    <td>
                        <select id="selBatch" class="easyui-combobox" name="selBatch" style="width: 154px;">
                            <option value="0">汇总</option>
                            <option value="1">第一批</option>
                            <option value="2">第二批</option>
                            <option value="3">第三批</option>
                            <option value="4">第四批</option>
                            <option value="5">第五批</option>
                            <option value="6">第六批</option>
                            <option value="7">第七批</option>
                            <option value="8">第八批</option>
                            <option value="9">第九批</option>
                            <option value="10">第十批</option>
                            <option value="11">第十一批</option>
                            <option value="12">第十二批</option>
                            <option value="13">第十三批</option>
                            <option value="14">第十四批</option>
                            <option value="15">第十五批</option>
                            <option value="16">第十六批</option>
                            <option value="17">第十七批</option>
                            <option value="18">第十八批</option>
                            <option value="19">第十九批</option>
                            <option value="20">第二十批</option>
                            <option value="21">第二十一批</option>
                            <option value="22">第二十二批</option>
                            <option value="23">第二十三批</option>
                            <option value="24">第二十四批</option>
                            <option value="25">第二十五批</option>
                        </select>
                    </td>
                    <td></td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid();">查询</a>

                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div style="min-height: 720px; width: 1700px;">
        <table id="dg" title="生产批次订单" style="min-height: 600px;">
            <thead>
                <tr>
                    <th data-options="field:'GOODSID',width:50">序号</th>
                    <th data-options="field:'GOODSCODE',width:100">货号</th>
                    <th data-options="field:'GOODSNAME',width:180">品名</th>
                    <th data-options="field:'BATCH_1',width:50">批次1</th>
                    <th data-options="field:'BATCH_2',width:50">批次2</th>
                    <th data-options="field:'BATCH_3',width:50">批次3</th>
                    <th data-options="field:'BATCH_4',width:50">批次4</th>
                    <th data-options="field:'BATCH_5',width:50">批次5</th>
                    <th data-options="field:'BATCH_6',width:50">批次6</th>
                    <th data-options="field:'BATCH_7',width:50">批次7</th>
                    <th data-options="field:'BATCH_8',width:50">批次8</th>
                    <th data-options="field:'BATCH_9',width:50">批次9</th>
                    <th data-options="field:'BATCH_10',width:50">批次10</th>
                    <th data-options="field:'BATCH_11',width:50">批次11</th>
                    <th data-options="field:'BATCH_12',width:50">批次12</th>
                    <th data-options="field:'BATCH_13',width:50">批次13</th>
                    <th data-options="field:'BATCH_14',width:50">批次14</th>
                    <th data-options="field:'BATCH_15',width:50">批次15</th>
                    <th data-options="field:'BATCH_16',width:50">批次16</th>
                </tr>
            </thead>
        </table>
    </div>
    @Html.Partial("~/Views/Shared/_PartialToolbar.cshtml", new Toolbar
{
    GridName = "dg",
    GridType = "datagrid",
    ToolbarName = "toolbar",
    FunctionModule = new Dictionary<string, List<FunctionModule>>()
    {
        {"Function",new List<FunctionModule>()
            {
              new FunctionModule(){Name = "Add",IsEnable =false },
              new FunctionModule(){Name = "Edit",IsEnable =false },
              new FunctionModule(){Name = "Remove",IsEnable =false },
              new FunctionModule(){Name = "Reload",IsEnable =false },
              new FunctionModule(){Name = "Collapse",IsEnable =false },
              new FunctionModule(){Name = "Exporter",IsEnable =true },
              new FunctionModule(){Name = "AllEdit",IsEnable =false },

            }
        }
    }
})

</body>

